@foreach($data as $key=>$value)
    @if($key % rand(2,4) == 0 && $value->cover)
        <div class="item text">
            <div class="main">
                <h2>{{ $value->title }}</h2>
                @if($value->cover)
                    <img src="{{ get_upload_url($value->cover) }}" alt="{{ $value->title }}">
                @endif
                <div class="brief">
                    <p>{!! $value->description !!}</p>
                </div>
                <a href="{{ get_home_url($value->document_type.'/detail/'.$value->id) }}" class="link"><span class="date">{{ substr($value->fixed_release_time, 0, 10) }}</span></a>
            </div>
        </div>
    @else

        <div class="item img">
            <div class="main">
                <h2>{{ $value->title }}</h2>
                <img src="{{ get_upload_url($value->cover) }}" alt="{{ $value->title }}">
                <a href="{{ get_home_url($value->document_type.'/detail/'.$value->id) }}" class="link"><span class="date">{{ substr($value->fixed_release_time, 0, 10) }}</span></a>
            </div>
        </div>
    @endif
@endforeach